There are several R set theory functions that can be very useful in solving complex problems. You can also use them to verify your solutions to simpler problems.
Most of what you need is in the arules
library. You can easily create a complement
function of your own.